using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Trigger : MonoBehaviour
{
    Animator animator;
    bool Opened=false;

    // Start is called before the first frame update
    void Start()
    {
        animator = GameObject.Find("Platform/Blocks/Door").GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {

    }

    private void OnCollisionEnter(Collision collision)
    {
        if (!Opened)
        {
            animator.SetTrigger("Open");
            Opened = true;
        }

    }


}
